home *** CD-ROM | disk | FTP | other *** search
- <!-- // --><script language=JavaScript>
- // #### BEGIN g_sTKMRoot DEFINITION ####
- // Start at the beginning of the location and find our document root directory
- var g_sHref = location.href.toLowerCase();
- var g_nEndPos = g_sHref.indexOf('outfitter/');
- // Grab everything up to the end of the word outfitter and add "/tkm/" to set the TKM Root
- var g_sTKMRoot = g_sHref.substring(0, (g_nEndPos + 9)) + '/tkm/';
- // Move past the "outfitter/" string and start looking for the geo/lang
- var g_nBeginGeo = g_nEndPos + 10;
- // Find the next "/" and we have the geo/lang
- var g_nEndGeo = g_sHref.indexOf('/', g_nBeginGeo);
- // Parse out the geo/lang so we know what to use
- var g_sGeo = g_sHref.substring(g_nBeginGeo, g_nEndGeo);
- // #### END g_sTKMRoot DEFINITION ####
-
- // #### BEGIN ADD DEPENDENCIES ####
- //document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objTU.js">');
- document.write('<script language="javascript1.2" src="/outfitter/tkm/scripts/objTU.js">');
- document.write('\n<' + '/script>\n');
- // #### END DEPENDENCIES ####
-
- function XML_PARSER()
- {
- this.LoadXMLFile = XP_LoadXMLFile;
- this.UnloadXML = XP_UnloadXML;
- this.GetFirstElement = XP_GetFirstElement;
- this.GetNextElement = XP_GetNextElement;
- this.GetElementTag = XP_GetElementTag;
- this.GetElementText = XP_GetElementText;
- this.GetAttributeValue2 = XP_GetAttributeValue2;
- this.GetFirstAttribute = XP_GetFirstAttribute;
- this.GetNextAttribute = XP_GetNextAttribute;
- this.GetAttributeValue = XP_GetAttributeValue;
- this.GetAttributeName = XP_GetAttributeName;
- this.GetElementType = XP_GetElementType;
- this.Init = XP_Init;
-
- this.CreateXML = XP_CreateXML;
- this.CheckXML = XP_CheckXML;
- this.CheckXML2 = XP_CheckXML2;
-
-
- this.clsid = '9D5E0252-6F5A-11D3-8B11-0090271F3E6F';
- this.ready = false;
- this.xmlLoaded = false;
- this.searchElem = '';
- this.searchAttrib = '';
- this.element = '';
- this.searchHandle = '';
- this.xmlHandle = '';
- this.subElemnt = '';
- this.flag = false;
- }
-
- function XP_GetElementType(handle, elmtHandle)
- {
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetElementType',handle, elemtHandle));
- else if(document.all) sRetVal = document.xmlp.GetElementType(handle, elmtHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
-
- //Loads the desired XML file in memory and
- //Creates an object for the pointer to the CXML file
- function XP_LoadXMLFile(fileName)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod1('LoadXMLFile', fileName));
- else if (document.all) sRetVal = document.xmlp.LoadXMLFile(fileName);
- this.xmlLoaded = true;
- this.xmlHandle = sRetVal;
- return sRetVal;
- }
- //Clears the memory of the XML file
- function XP_UnloadXML(fileName)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod1('UnloadXML', fileName));
- else if (document.all) sRetVal = document.xmlp.UnloadXML(fileName);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns a pointer to the first element
- // 0 is the root element
- function XP_GetFirstElement(handle, parentHandle, tagName)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod3('GetFirstElement', handle, parentHandle, tagName));
- else if (document.all) sRetVal = document.xmlp.GetFirstElement(handle, parentHandle, tagName);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns a pointer to the next element
- function XP_GetNextElement(handle, siblingHandle, tagName)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod3('GetNextElement', handle, siblingHandle, tagName));
- else if (document.all) sRetVal = document.xmlp.GetNextElement(handle, siblingHandle, tagName);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the name of element pointer passed in.
- function XP_GetElementTag(xmlHandle, elmtHandle)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetElementTag', xmlHandle, elmtHandle));
- else if (document.all) sRetVal = document.xmlp.GetElementTag(xmlHandle, elmtHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
-
- function XP_GetElementText(xmlHandle, elmtHandle)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetElementText', xmlHandle, elmtHandle));
- else if (document.all) sRetVal = document.xmlp.GetElementText(xmlHandle, elmtHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the value of the attribute when passed the appropriate pointers
- function XP_GetAttributeValue2(xmlHandle, elmtHandle, attribute)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod3('GetAttributeValue2', xmlHandle, elmtHandle, attribute));
- else if (document.all) sRetVal = document.xmlp.GetAttributeValue2(xmlHandle, elmtHandle, attribute);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the first attribute of an element
- function XP_GetFirstAttribute(xmlHandle, parentHandle)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetFirstAttribute', xmlHandle, parentHandle));
- else if (document.all) sRetVal = document.xmlp.GetFirstAttribute(xmlHandle, parentHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the next attribute
- function XP_GetNextAttribute(xmlHandle, attribute)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetNextAttribute', xmlHandle, attribute));
- else if (document.all) sRetVal = document.xmlp.GetNextAttribute(xmlHandle, attribute);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the value of the element attribute
- function XP_GetAttributeValue(xmlHandle, elmtHandle)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetAttributeValue', xmlHandle, elmtHandle));
- else if (document.all) sRetVal = document.xmlp.GetAttributeValue(xmlHandle, elmtHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
- //Returns the name of the element attribute
- function XP_GetAttributeName(xmlHandle, elmtHandle)
- {
- sRetVal = '';
- if(document.layers) sRetVal = new String(document.xmlp.callMethod2('GetAttributeName', xmlHandle, elmtHandle));
- else if (document.all) sRetVal = document.xmlp.GetAttributeName(xmlHandle, elmtHandle);
- sRetVal = sRetVal.toString();
- return sRetVal;
- }
-
- function XP_Init()
- {
- /* If the client is installed and completely up-to-date */
- if (ti.status == ti.INSTALLED)
- {
- if (document.layers) document.write('<embed type="application/x-weboutfitter-container" name="xmlp" width="" height="" clsid="{' + this.clsid + '}">');
- else if (document.all) document.write('<object id="xmlp" name="xmlp" classid="clsid:' + this.clsid + '" height=0 width=0></object>');
- this.ready = true;
- }
- tu.Init();
- }
-
- //***********************************************************************************************//
-
- function XP_CheckXML2(sToolKey, sOSKey, sElement) {
-
- sToolKey = sToolKey.toUpperCase();
- sOSKey = sOSKey.toUpperCase();
- sElement = sElement.toUpperCase();
-
- var ToolElement = xp.GetFirstElement(xp.xmlHandle, "0", sElement);
- var retval = 0; // - Tool not found
-
- for( ; ToolElement != ""; ToolElement = xp.GetNextElement(xp.xmlHandle, ToolElement, sElement))
- {
- if(sToolKey == xp.GetAttributeValue2(xp.xmlHandle, ToolElement, "KEY"))
- {
- retval = 1; // - No OS key
- var l_key = xp.GetFirstAttribute(xp.xmlHandle, ToolElement);
- for( ; l_key != ""; l_key = xp.GetNextAttribute(xp.xmlHandle, l_key2))
- {
- l_key2 = l_key;
- if(sOSKey == xp.GetAttributeName(xp.xmlHandle, l_key)) retval = xp.GetAttributeValue(xp.xmlHandle, l_key);
- }
- break;
- }
- }
- return retval;
- }
-
- function XP_CheckXML(sToolKey, sOSKey, sElement, sSubElement) {
-
- var ToolElement = xp.GetFirstElement(xp.xmlHandle, "0", sElement);
- var retval = 0; // - Tool not found
-
- for( ; ToolElement != ""; ToolElement = xp.GetNextElement(xp.xmlHandle, ToolElement, sElement))
- {
- if(sToolKey == xp.GetAttributeValue2(xp.xmlHandle, ToolElement, "KEY"))
- {
- retval = 1; // - No OS element
- var OSElement = xp.GetFirstElement(xp.xmlHandle, ToolElement, sSubElement);
- for( ; OSElement != ""; OSElement = xp.GetNextElement(xp.xmlHandle, OSElement, sSubElement))
- {
- retval = 2; // - OS mismatch
- if(sOSKey == xp.GetElementText(xp.xmlHandle, OSElement))
- {
- retval = 3; // - OS match
- break;
- }
- }
- break;
- }
- }
- return retval;
- }
-
- function XP_CreateXML(file)
- {
- var medium = "MEDIUM='CD'";
- var xmlname = file;
-
- //Returns the complete file name
- xmlname = tu.GetXMLFileName(xmlname, medium);
-
- //Creates the xp.xmlHandle
- xp.LoadXMLFile(xmlname);
- }
-
- var xp = new XML_PARSER();
- //--></script>